package sealed

/**
 *@ClassName Main
 *
 *@Author ykx
 *@Date  2024/6/18 20:54
 *@Version 1.0
 */
fun main(args: Array<String>) {
    var s1: Son = Son.小小驴()
    var s2: Son = Son.小骡子()
    var s3: Son = Son.小小驴()

    var sons = listOf(s1, s2, s3)
    for (son in sons) {
        if (son is Son.小小驴) {
            son.sayHello()
        }
    }
}